﻿using DatabaseGroup.SSIS.SourceAdapters.Parser;

namespace DatabaseGroup.UnitTests.SSIS.SourceAdapters.Parser
{
    /// <summary>
    /// Implements IParsingState with dummy functionality for testing
    /// </summary>
    internal class ParsingStateTestImpl : IParsingState
    {
        private ParsingResult result = ParsingResult.Match;

        /// <summary>
        /// Initializes a new instance of ParsingStateTestImpl using the parsing result
        /// </summary>
        /// <param name="result">The parsing result to return on calling ProcessCharacter</param>
        public ParsingStateTestImpl(ParsingResult result)
        {
            this.result = result;
        }

        #region IParsingState Members

        public void AddNextState(IParsingState nextState)
        {
        }

        public void SetErrorState(IParsingState errorState)
        {
        }

        public ParsingResult ProcessCharacter(IParsingContext context, char nextChar)
        {
            return result;
        }

        #endregion
    }
}